<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:totoland="http://java.sun.com/jsf/composite/components">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="${request.contextPath}/resources/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
            <script src="${request.contextPath}/resources/js/html5.js"></script>
        <link rel="stylesheet" href="${request.contextPath}/resources/css/style.css" media="screen"/>
        
        <link rel="stylesheet" href="${request.contextPath}/resources/css/style.responsive.css" media="all"/>

    </h:head>
    <h:body id="body013">
        <p:blockUI block="body013"  widgetVar="blogui013">
            LOADING<br />
            <img src="${request.contextPath}/resources/images/preloader-01.gif"/>
        </p:blockUI>
        <p:ajaxStatus onstart="blogui013.show()" oncomplete="blogui013.hide()"/>
        <h:form>

            <p:panel id="REPORT_013" header="#{msg.report_013_header}">

                <p:panel id="REPORT_REPORT_013" header="#{formReport013Controller.reportTitle}">


                    <p:messages id="REPORT_013msgFrmDetails"></p:messages>

                    <script>
                        //<![CDATA[
                        function sum(obj) {
                            if (obj.value != 0) {
                                calSum();
                            }
                            return false;
                        }
                        //]]>
                    </script>

                    <p:remoteCommand name="calSum" update="REPORT_013pnlFrm" onstart="blogui013.show();" oncomplete="blogui013.hide()" actionListener="#{formReport013Controller.calSum()}">
                    </p:remoteCommand>

                    <p:panelGrid styleClass="frmDetail" id="REPORT_013pnlFrm" style="text-align: center;vertical-align: middle">
                        <f:facet name="header">
                            <p:row>  
                                <p:column rowspan="2" style="text-align: center;vertical-align: middle;width: 170px">ประเภทการเลือกตั้ง</p:column>
                                <p:column rowspan="2" style="text-align: center;vertical-align: middle;width: 90px">คำวินิจฉัยที่ต้องจัดทำ (เรื่อง) (1)</p:column>
                                <p:column colspan="4" style="text-align: center;vertical-align: middle;">การดำเนินการ (เรื่อง)</p:column>
                                <p:column colspan="2" style="text-align: center;vertical-align: middle;">ส่งคำวินิจฉัยให้ ผอ. กกต.จว. (เรื่อง)</p:column>
                            </p:row>
                            <p:row>
                                <p:column colspan="1" style="text-align: center;width: 90px">กำลังจัดทำ (2)</p:column>
                                <p:column colspan="1" style="text-align: center;width: 90px">จัดทำเสร็จ (3)</p:column>
                                <p:column colspan="1" style="text-align: center;width: 90px">อยู่ระหว่างเสนอ กกต. ลงนาม (4)</p:column>
                                <p:column colspan="1" style="text-align: center;width: 90px">กกต. ลงนามครบถ้วน (5)</p:column>
                                <p:column colspan="1" style="text-align: center;width: 90px">ส่งแล้ว (6)</p:column>
                                <p:column colspan="1" style="text-align: center;width: 90px">ค้างส่ง (7)</p:column>
                            </p:row>
                        </f:facet>
                        <p:row>
                            <p:column style="text-align: left">
                                <p:autoComplete disabled="#{formReport013Controller.paramMode=='view'}"   dropdown="true" value="#{formReport013Controller.report013Details[0].institution}" 
                                                completeMethod="#{formReport013Controller.dropdownFactory.listDntSelection()}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[0].decisionToPrepare}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)" value="#{formReport013Controller.report013Details[0].onProcess}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[0].complete}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[0].ectSignedOnprocess}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[0].ectSignedComplee}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[0].sended}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[0].noSend}">

                                </totoland:inputNumber>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column style="text-align: left">
                                <p:autoComplete disabled="#{formReport013Controller.paramMode=='view'}"   dropdown="true" value="#{formReport013Controller.report013Details[1].institution}" 
                                                completeMethod="#{formReport013Controller.dropdownFactory.listDntSelection()}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[1].decisionToPrepare}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)" value="#{formReport013Controller.report013Details[1].onProcess}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[1].complete}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[1].ectSignedOnprocess}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[1].ectSignedComplee}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[1].sended}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[1].noSend}">

                                </totoland:inputNumber>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column style="text-align: left">
                                <p:autoComplete disabled="#{formReport013Controller.paramMode=='view'}"   dropdown="true" value="#{formReport013Controller.report013Details[2].institution}" 
                                                completeMethod="#{formReport013Controller.dropdownFactory.listDntSelection()}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[2].decisionToPrepare}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)" value="#{formReport013Controller.report013Details[2].onProcess}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[2].complete}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[2].ectSignedOnprocess}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[2].ectSignedComplee}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[2].sended}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[2].noSend}">

                                </totoland:inputNumber>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column style="text-align: left">
                                <p:autoComplete disabled="#{formReport013Controller.paramMode=='view'}"   dropdown="true" value="#{formReport013Controller.report013Details[3].institution}" 
                                                completeMethod="#{formReport013Controller.dropdownFactory.listDntSelection()}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[3].decisionToPrepare}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)" value="#{formReport013Controller.report013Details[3].onProcess}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[3].complete}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)" value="#{formReport013Controller.report013Details[3].ectSignedOnprocess}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[3].ectSignedComplee}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[3].sended}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[3].noSend}">

                                </totoland:inputNumber>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column style="text-align: left">
                                <p:autoComplete disabled="#{formReport013Controller.paramMode=='view'}"   dropdown="true" value="#{formReport013Controller.report013Details[4].institution}" 
                                                completeMethod="#{formReport013Controller.dropdownFactory.listDntSelection()}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[4].decisionToPrepare}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)" value="#{formReport013Controller.report013Details[4].onProcess}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.report013Details[4].complete}"/>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[4].ectSignedOnprocess}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <h:outputText  value="#{formReport013Controller.report013Details[4].ectSignedComplee}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[4].sended}">

                                </totoland:inputNumber>
                            </p:column>
                            <p:column>
                                <totoland:inputNumber disabled="#{formReport013Controller.paramMode=='view'}" onchange="sum(this)"  value="#{formReport013Controller.report013Details[4].noSend}">

                                </totoland:inputNumber>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column>
                                <h:outputText value="รวม"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.sumDetail.decisionToPrepare}"/>
                            </p:column>
                            <p:column>
                                <h:outputText  value="#{formReport013Controller.sumDetail.onProcess}"/>
                            </p:column>
                            <p:column>
                                <h:outputText value="#{formReport013Controller.sumDetail.complete}"/>
                            </p:column>
                            <p:column>
                                <h:outputText   value="#{formReport013Controller.sumDetail.ectSignedOnprocess}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <h:outputText  value="#{formReport013Controller.sumDetail.ectSignedComplee}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <h:outputText   value="#{formReport013Controller.sumDetail.sended}">

                                </h:outputText>
                            </p:column>
                            <p:column>
                                <h:outputText   value="#{formReport013Controller.sumDetail.noSend}">

                                </h:outputText>
                            </p:column>
                        </p:row>

                    </p:panelGrid>
                    <h:panelGroup id="REPORT_013pnlCmd" rendered="#{formReport013Controller.report013.flowStatusId!=200}">
                        <div align="center">
                            <p:commandButton value="#{msg.btn_save}" actionListener="#{formReport013Controller.save()}" id="REPORT_013btnSave" rendered="#{formReport013Controller.paramMode=='create'}"/>
                            <p:commandButton value="#{msg.btn_edit}" actionListener="#{formReport013Controller.goToEdit()}" id="REPORT_013btnEdit" rendered="#{formReport013Controller.paramMode=='view' 
                                                      and formReport013Controller.canEdit(formReport013Controller.report013.createdUserGroup,formReport013Controller.report013.reportStatus,formReport013Controller.report013.flowStatusId)}"/>
                            <p:commandButton value="#{msg.btn_close}" actionListener="#{formReport013Controller.goToClose()}" id="REPORT_013btnClose" rendered="#{formReport013Controller.paramMode=='view' || formReport013Controller.paramMode=='create'}"/>
                            <p:commandButton value="#{msg.btn_save}" actionListener="#{formReport013Controller.edit()}" id="REPORT_013btnSaveEdit" rendered="#{formReport013Controller.paramMode=='edit'}"/>
                            <p:commandButton value="#{msg.btn_cancel}" id="REPORT_013btnCancel" actionListener="#{formReport013Controller.goToCancel()}" rendered="#{formReport013Controller.paramMode=='edit'}"/>
                        </div>
                    </h:panelGroup>
                </p:panel>

            </p:panel>
        </h:form>
        <style>
            input[type="text"] {
                clear: left;
                cursor: text;
                list-style-type: none;
                margin: 0;
                min-height: 1px;
                overflow: hidden;
                width: 90px;
            }
        </style>
    </h:body>
</html>